{
  "properties" : { },
  "id" : "6e2379bbfc944fb0bc460cff086b7df7",
  "script" : null,
  "groupId" : "43da313fdeaa495798cf783e6cf83479",
  "name" : "删除分组",
  "createTime" : 1727070848631,
  "updateTime" : 1726046013631,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "removeTree",
  "method" : "GET",
  "parameters" : [ {
    "name" : "id",
    "value" : "c739c4eb226440f1a56fc5070a6afa63",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": true\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : null,
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  },
  "responseBodyDefinition" : {
    "name" : null,
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }
}
================================
  import cn.hutool.core.collection.CollectionUtil
  import org.springblade.core.tool.api.R

  List childrenIpGroup = db.table("ndmp_ip_group").where().eq("parent_id", id).select();
  if (!CollectionUtil.isEmpty(childrenIpGroup)) {
      return R.fail("请先删除子分组");
  }

  var ipGroup = db.table("ndmp_ip_group").where().eq("id", id).selectOne();
  var parentId = ipGroup.get("parentId")::string;
  if ("9999".equals(parentId)) {
      db.table("ndmp_ip_source_manager").where().eq("group_id", id).delete();
  } else {
      db.update("""
  update
          ndmp_ip_source_manager
         set  group_id = #{parentId}
         where  group_id = #{id}
""")


  }
  return db.table("ndmp_ip_group").where().eq("id", id).delete() == 1;